package com.analyse.stock.model;

import com.analyse.stock.vo.TickerVO;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_country_info")
public class CountryInfoModel extends BaseModel<CountryInfoModel> {

    //国家或地区代码
    private String countryCode;

    //国家或地区代码
    private String countryName;

    //时区
    private String timezone;
    //延时
    private String delay;
    //备注
    private String notes;

    public static CountryInfoModel transCountryInfoModel(TickerVO tickerVO) {
        CountryInfoModel model = new CountryInfoModel();
        model.setCountryCode(tickerVO.getCountryCode());
        model.setCountryName(tickerVO.getCountryName());
        model.setTimezone(tickerVO.getTimezone());
        model.setDelay(tickerVO.getDelay());
        model.setNotes(tickerVO.getNotes());
        model.setUpdateTime(new Date());
        model.setCreateTime(new Date());
        return model;
    }
}
